﻿@{
    ViewBag.Title = "开店";
}
@section CSS{
    <link href="~/Content/css/layerui/layui.css" rel="stylesheet" />
}
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <section class="content-header">
        <h1>
            设置
            <small>店铺商品类别</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="#">商家管理</a></li>
            <li><a href="/shop/store">店铺列表</a></li>
            <li class="active">设置店铺商品类别</li>
        </ol>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box">
                    <div class="box-body">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form class="form-horizontal" id="from-add">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">店铺名称：</label>
                                        <div class="col-sm-9">
                                            <label class="control-label"> @ViewBag.name</label>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">店铺商品类别：</label>
                                        <div class="col-sm-3">
                                            <div>
                                                <label class="control-label">商品类型</label>
                                                <div style="margin-top: 10px;">
                                                    <select style="width: 150px; height: 30px;" name="Shop_category" id="Shop_category" required="" aria-required="true">
                                                        <option value="1">普通商品</option>
                                                        <option value="3">趣卡专享商品</option>
                                                        <option value="2">合力免单商品</option>
                                                        <option value="4">1元购商品</option>

                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-3">
                                            <div>
                                                <label class="control-label">一级类目</label>
                                                <div style="margin-top: 10px;">
                                                    <select style="width: 150px; height: 30px;" name="gc_id1" id="gc_id1" required="" aria-required="true"></select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-3">
                                            <div>
                                                <label class="control-label">二级类目</label>
                                                <div style="margin-top: 10px;">
                                                    <select style="width: 150px; height: 30px; display: none;" name="gc_id2" id="gc_id2" required="" aria-required="true"></select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label"></label>
                                        <div class="col-sm-9">
                                            <button type="button" class="layui-btn" id="addTables"><i class="fa fa-plus">添加店铺商品类别</i></button>
                                            <span class="help-block m-b-none">注:经营多个类别，请点击"增加店铺类别"按钮继续添加，全部添加完后再提交</span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label"></label>
                                        <div class="col-sm-9 table-responsive">
                                            <table class="table table-bordered table-striped" id="mytable">
                                                <thead>
                                                    <tr>
                                                        <th>商品类型</th>
                                                        <th>一级类目</th>
                                                        <th>二级类目</th>
                                                        <th>操作</th>
                                                    </tr>
                                                </thead>
                                                <tbody></tbody>
                                            </table>
                                        </div>
                                    </div>

                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-3">
                                            <button class="btn btn-primary" type="button" id="btnSave">提交信息</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

</div>

@section JS{
    <script src="~/Content/js/jquery.form.js"></script>
    <script src="~/Content/plugins/validate/jquery.validate.min.js"></script>
    <script src="~/Content/plugins/validate/messages_zh.min.js"></script>
    <script type="text/javascript">
        var _id="@ViewBag.id";
        $(function () {
            var Shop_category = $("#Shop_category").val();
            getClass(0, "#gc_id1",1 );
            if (_id != undefined&&_id!="0") {
                $("#id").val(_id);
                getInfo(_id);
            }
            else{layer.msg("店铺参数错误，请重试！", { icon: 5, time: 2000 });}
        });
    </script>
    <script src="~/Content/js/StoreCategory.js"></script>
}




